package vip.liux.contracts.models.pay;


import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import vip.liux.contracts.shared.enums.pay.PayRefundStatus;
import vip.liux.domain.entities.auditing.CreationAuditedEntity;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 会员钱包充值
 */
@Getter
@Setter
@Entity
@Table(name = "pay_wallet_recharge")
@Accessors(chain = true)
public class PayWalletRecharge extends CreationAuditedEntity<Long> {

    /**
     * 钱包编号
     * <p>
     * 关联 {@link PayWallet#getId()}
     */
    private Long walletId;

    /**
     * 用户实际到账余额
     * <p>
     * 例如充 100 送 20，则该值是 120
     */
    private BigDecimal totalPrice;

    /**
     * 实际支付金额
     */
    private BigDecimal payPrice;

    /**
     * 钱包赠送金额
     */
    private BigDecimal bonusPrice;

    /**
     * 是否已支付
     * <p>
     * true - 已支付
     * false - 未支付
     */
    private Boolean payStatus;

    /**
     * 支付订单编号
     * <p>
     * 关联 {@link PayOrder#getOrderNo()}
     */
    private String payOrderNo;

    /**
     * 支付成功的支付渠道
     * <p>
     * 冗余 {@link PayOrder#getChannelCode()}
     */
    private String payChannelCode;

    /**
     * 订单支付时间
     */
    private LocalDateTime payTime;

    /**
     * 支付退款单编号
     * <p>
     * 关联 {@link PayRefund#getRefundNo()}
     */
    private String payRefundNo;

    /**
     * 退款金额，包含赠送金额
     */
    private BigDecimal refundTotalPrice;

    /**
     * 退款支付金额
     */
    private BigDecimal refundPayPrice;

    /**
     * 退款钱包赠送金额
     */
    private BigDecimal refundBonusPrice;

    /**
     * 退款时间
     */
    private LocalDateTime refundTime;

    /**
     * 退款状态
     * <p>
     * 枚举 {@link PayRefundStatus}
     */
    private PayRefundStatus refundStatus;
}
